home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / swingall.jar / javax / swing / text / html / Option.class (.txt) < prev    next >
Encoding:
Java Class File  |  1999-07-15  |  1.2 KB  |  49 lines

  1. package javax.swing.text.html;
  2.  
  3. import javax.swing.text.AttributeSet;
  4. import javax.swing.text.html.HTML.Attribute;
  5.  
  6. public class Option {
  7.    private boolean selected;
  8.    private String label;
  9.    private AttributeSet attr;
  10.  
  11.    public Option(AttributeSet var1) {
  12.       this.attr = var1.copyAttributes();
  13.       this.selected = var1.getAttribute(Attribute.SELECTED) != null;
  14.    }
  15.  
  16.    public AttributeSet getAttributes() {
  17.       return this.attr;
  18.    }
  19.  
  20.    public String getLabel() {
  21.       return this.label;
  22.    }
  23.  
  24.    public String getValue() {
  25.       String var1 = (String)this.attr.getAttribute(Attribute.VALUE);
  26.       if (var1 == null) {
  27.          var1 = this.label;
  28.       }
  29.  
  30.       return var1;
  31.    }
  32.  
  33.    public boolean isSelected() {
  34.       return this.selected;
  35.    }
  36.  
  37.    public void setLabel(String var1) {
  38.       this.label = var1;
  39.    }
  40.  
  41.    protected void setSelection(boolean var1) {
  42.       this.selected = var1;
  43.    }
  44.  
  45.    public String toString() {
  46.       return this.label;
  47.    }
  48. }
  49.